float4x4 g_world_view_proj : WORLD_VIEW_PROJ;

texture g_texture : DIFFUSEMAP
< 
    string file_name = "default_color.dds";
>;

sampler g_tex_sampler = sampler_state {
    Texture = <g_texture>; 
    MipFilter = LINEAR;
    MinFilter = LINEAR;
    MagFilter = LINEAR;
    AddressU = WRAP;
    AddressV = WRAP;
}; 

struct VS_OUTPUT
{
    float4 position     :   POSITION;
    float2 uv           :   TEXCOORD0;
};

VS_OUTPUT vs_main( float3 pos : POSITION, 
                   float2 uv : TEXCOORD0)
{
    VS_OUTPUT output;
    
    output.position = mul(float4(pos.xyz,1), g_world_view_proj);
    output.uv.xy = uv.xy;
    
    return output;
}

struct PS_OUTPUT
{
    float4 color : COLOR0; 
};

PS_OUTPUT ps_main( VS_OUTPUT IN) 
{
    PS_OUTPUT output;

    output.color = tex2D(g_tex_sampler, IN.uv); 
    
    return output;
}

technique technique0 {
        pass p0 {
                CullMode = None;
                VertexShader = compile vs_2_0 vs_main();
                PixelShader = compile ps_2_0 ps_main();
        }
}

